import java.io.File;
import java.util.Scanner;

public class Test14 {

    public static void main1(String[] args) {
        System.out.println(getLCA(9, 5));
    }
    public static int getLCA(int a, int b) {
        // write code here
        int min = Math.min(a,b);
        //如何判断两个结点是否在同一层
        int max = Math.max(a,b);
        while (true){
            if(max > min){
                max/=2;
            }else if(max < min){
                min/=2;
            }else {
                return max;
            }

        }

    }

    public static void main2(String[] args) {
       Scanner scanner = new Scanner(System.in);
       int p = scanner.nextInt();
        int sum = 0;
        int max = 0;
        for (int i = 0; i < 32; i++) {
            if((p&1) == 1){
                sum++;
                if(sum > max){
                    max = sum;
                }
            }else{
                sum=0;
            }
            p>>=1;
        }
        System.out.println(max);
    }

    public static void main(String[] args) {
        File file = new File("D:/pp.txt");

    }
}
